import {getGas, getWeather} from './prevent/weather/weather'
import axios from "axios";
import {login} from "@/net/login/login";
import {getMechine} from "@/net/prevent/mechine/mechine";
import {getMember} from "@/net/prevent/memble/member";
import {sendMessage} from "@/net/prevent/sendMessage/sendMessage";
import {getSpyPoint} from "@/net/prevent/spyPoint/spyPoint";
import {getTemplate} from "@/net/prevent/tamplate/template";
import {getUserinfo} from "@/net/user/user";
import {getArea} from "@/net/agriculture/agricultureArea/agricultureArea";
import {getFarmer} from "@/net/agriculture/farmer/farmer";
import {getPlantSituation} from "@/net/agriculture/planting/plantSituation";
import {getDetail} from "@/net/prevent/materialDetail/getDetail";
import {getItemDetail} from "@/net/prevent/itemDetail/itemDetail";
import {getTravel} from "@/net/travel/travel";
import {areaEdit} from "@/net/edit/areaEdit";

// 添加响应拦截器


axios.interceptors.response.use(function (response) {
    // 2xx 范围内的状态码都会触发该函数。
    // 对响应数据做点什么
    return response;
}, function (error) {
    // 超出 2xx 范围的状态码都会触发该函数。
    // 对响应错误做点什么
    console.log(error.response)
    // if (error.response.status === 401) {
    //     console.log('未授权的访问，请登录！')
    //     clearCookie('dongzhou')
    //     // this.$router
    // }
    return Promise.reject(error);
});
export {
    getGas, getWeather, login,
    getMechine, getMember, sendMessage,
    getSpyPoint, getTemplate, getUserinfo,
    getArea, getFarmer, getPlantSituation
    , getDetail, getItemDetail, getTravel
    , areaEdit
};